/**
 * DataSourceBean.java : [com.shift.converter.editors.beans] Created on 2009. 5. 5.
 * 
 * Copyright (c) 2000-2008 Shift Information & Communication Co.
 * 5F, Seongsu Venture town, 231-1, Seongsu2-Ga Seongdong-Gu, Seoul, Korea 133-826
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Shift Information & Communication Co. ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use 
 * it only in accordance with the terms of the license agreement you 
 * entered into with Shift Information & Communication.
 */
package com.shift.converter.beans;

import java.util.HashMap;
import java.util.Map;


public class DataSourceBean {

	public static final String TYPE_CHANGED = "DATASOURCE_TYPE_CHANGED";

	public static final String CHARSET_CHANGED = "DATASOURCE_CHARSET_CHANGED";

	public static final String NAME_CHANGED = "DATASOURCE_NAME_CHANGED";
	
	public static final String VALUE_CHANGED = "DATASOURCE_VALUE_CHANGED";
	
	
	public static final String TYPE_XML = "XML";
	public static final String TYPE_JSON = "JSON";
	
	/**
	 * Default data type
	 * @version Data Converter 1.0.0.0
	 */
	public static final String URLTYPE_DEFAULT = TYPE_XML;

	/**
	 * XML read default charset
	 */
	public static final String CHARSET_DEFULT = "UTF-8";
	
	/**
	 * Data type
	 * @version Data Converter 1.0.0.0 
	 */
	private String type = URLTYPE_DEFAULT;
	
	/**
	 * Data incoding type
	 * @version Data Converter 1.0.0.0
	 */
	private String charset = CHARSET_DEFULT;
	
	/**
	 * Data url name
	 * @version Data Converter 1.0.0.0
	 */
	private String name = "";
	
	private Map paramMap = new HashMap();
	
	/**
	 * Data url
	 * @version Data Converter 1.0.0.0
	 */
	private String value = "";
	
	private MapConfigBean mapConfigBean;


	public DataSourceBean() {
		this.mapConfigBean = new MapConfigBean();
	}
	
	public DataSourceBean(MapConfigBean mapConfigBean) {
		this.mapConfigBean = mapConfigBean;
	}
	
	public String getType() {
		return type;
	}

	public void setType(String type) {
		String oldValue = this.type;
		this.type = type;
		mapConfigBean.firePropertyChange(TYPE_CHANGED, oldValue, this);
	}
	
	public String getCharset() {
		return charset;
	}
	
	public void setCharset(String charset) {
		String oldValue = this.charset;
		this.charset = charset;
		mapConfigBean.firePropertyChange(CHARSET_CHANGED, oldValue, this);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		String oldValue = this.name;
		this.name = name;
		mapConfigBean.firePropertyChange(NAME_CHANGED, oldValue, this);
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		String oldValue = this.value;
		this.value = value;
		mapConfigBean.firePropertyChange(VALUE_CHANGED, oldValue, this);
	}
	
	public Map getParamMap() {
		return paramMap;
	}
	
	public void setParamMap(Map paramMap) {
		this.paramMap = paramMap;
	}
}
